package com.easy.concert.mapper;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.easy.common.bean.ConcertBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ConcertMapper extends BaseMapper<ConcertBean> {

    // 联表查询：根据演唱会ID查询，关联场地表获取name和address
    @Select("SELECT c.*, v.name AS venueName, v.address AS venueAddress " +
            "FROM concert c " +
            "LEFT JOIN venue v ON c.venueid = v.id " +
            "WHERE c.id = #{id}")
    ConcertBean selectConcertWithVenue(Integer id);

}
